import Vue from 'vue'
import dayjs from 'dayjs'
import relativeTime  from 'dayjs/plugin/relativeTime'
import 'dayjs/locale/zh-cn'

dayjs.locale('zh-cn')
dayjs.extend(relativeTime)

Vue.filter('relativeTime', function(val) {
  return dayjs().to(dayjs(val))
})
